<template>
	<div>
        <h1>select:</h1>
		<el-select
			v-if="enable"
			class="path-select"
			v-model="model"
			filterable
			placeholder="请选择"
            :disabled="disabled"
		>
			<el-option
				v-for="(item, index) in options"
				:key="index"
				:label="item.label"
				:value="item.value"
			>
			</el-option>
		</el-select>
		<span v-else>{{ value || '---' }}</span>
	</div>
</template>

<script>
export default {
	props: {
		value: { type: [Number,String] },
		enable: { type: Boolean },
		disabled: { type: Boolean },
		options: { type: Array },
	},
	data() {
		return {
			model: '',
		}
	},
	watch: {
		model(newVal) {
			this.$emit('input', newVal)
		},
	},
}
</script>

<style>
</style>